all: rsaen
	mkdir -p bin; mv rsaen bin/; mv main.o bin/

%.o: %.cpp
	g++ -c -O2 -Wall -Wextra -pedantic $<

library-objects = \
	bin/BigUnsigned.o \
	bin/BigInteger.o \
	bin/BigIntegerAlgorithms.o \
	bin/BigUnsignedInABase.o \
	bin/BigIntegerUtils.o \

rsaen: main.o $(library-objects) cryptStream.o
	g++ $^ -o $@

cryptStream.o: cryptStream.cpp $(library-objects)

main.o: main.cpp cryptStream.o

$(library-objects):
	cd bigInt; make

clean:
	rm bin/rsaen bin/main.o bin/cryptStream.o; cd bigInt; make clean
